/*
 *  GameApplication.cpp
 *  NV
 *
 *  Created by Jason Townes French on 4/30/08.
 *
 */

#include "GameApplication.h"

GameApplication::GameApplication()
{
	// Provide a nice cross platform solution for locating the configuration files
	// On windows files are searched for in the current working directory, on OS X however
	// you must provide the full path, the helper function macBundlePath does this for us.
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
	mResourcePath = macBundlePath() + "/Contents/Resources/";
#else
	mResourcePath = "";
	//mGameManager = new GameManager();
#endif
}

GameApplication::~GameApplication()
{
	if(mGameManager)
		delete mGameManager;
}

void GameApplication::go()
{
	if (!mGameManager)
	{
		return;
	}
	GameManager::getSingleton().setResourcePath(mResourcePath);
	PlayState* s = new PlayState();
	GameManager::getSingleton().pushState(s );
	GameManager::getSingleton().start(s);
}

std::string GameApplication::getResourcePath()
{
	return mResourcePath;
}
